<?php

namespace frontend\models;

use yii\db\ActiveRecord;
use zhelyabuzhsky\sitemap\models\SitemapEntityInterface;

class Sltopic extends ActiveRecord implements SitemapEntityInterface
{
    /**
     * @inheritdoc
     */
    public function getSitemapLastmod()
    {
        return date('c');
    }

    /**
     * @inheritdoc
     */
    public function getSitemapChangefreq()
    {
        return 'daily';
    }

    /**
     * @inheritdoc
     */
    public function getSitemapPriority()
    {
        return 0.9;
    }

    /**
     * @inheritdoc
     */
    public function getSitemapLoc()
    {
//        return 'http://localhost/' . $this->slug;
        return \Yii::$app->params['frontend_domain'] . '/sltopic/' .$this->id;
    }

    /**
     * @inheritdoc
     */
    public static function getSitemapDataSource()
    {
        return self::find()->select(['id','created_at']);
    }
}
